package com.from2112.study

//!!!!   kotlin已经不需要区分装箱类型和非装箱类型，所有定义都是大写，如Shot、Int、Char
val aBoolean: Boolean = true
val anotherBoolean: Boolean = false
val aShort: Short = 1
val str:String = String(charArrayOf('h','m','m'))

fun main(args: Array<String>) {
    show(12)
    val a = 1
    val l: Long = a.toLong()        //基本数据类型不可以隐式转换
    println(str)
}

fun show(a: Number) {
    if (a is Short) {
        println(a.toChar())
    } else {
        println("a is not a Short")
    }
}